package buco.integrity.behaviour;

import org.json.simple.*;

import buco.core.api.SemanticConstraint;

public class CheckProtocol extends SemanticConstraint {

	private String className; 
	private String sequence;
	
	public CheckProtocol() {
		
	}
	
	@Override
	protected void deserialize(JSONObject jsonObject) throws Exception {
		className = jsonObject.get("class").toString(); 
		JSONArray sequenceArr = (JSONArray) jsonObject.get("sequence");
		
		StringBuilder sb = new StringBuilder(); 
		for(int i=0; i < sequenceArr.size(); i++) {
			sb.append(sequenceArr.get(i)); 
		}
		
		sequence = sb.toString(); 
	}

	public String getClassName() {
		return className;
	}

	public String getSequence() {
		return sequence;
	}	
}
